public class InterfaceDemo10 {
    public static void main(String[] args) {
        Customer customer = new Customer("张凯明");
        customer.eat(new WestCook());
    }
}


// 抽象接口
interface IFood {
    void cookie();
}

class EastCook implements IFood {

    @Override
    public void cookie() {
        System.out.println("做中国菜");
    }
}

class WestCook implements IFood {

    @Override
    public void cookie() {
        System.out.println("做西方菜");
    }
}


// 顾客
class Customer {
    private String name;

    public Customer(String name) {
        this.name = name;
    }

    public void eat(IFood food) {
        food.cookie();
    }
}
